<%@page pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/include.jsp"  %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<html>
<head>
    <title>User's recipes</title>
</head>
<body>
<c:import url="../pagemenus/mainUserMenu.jsp"/>
<br/>

<table border="1">
    <tr>
        <th>recipe</th>
        <th>action</th>
    </tr>
    <c:forEach var="userRecipe" items="${recipes}">
        <c:set var="recipe" value="${userRecipe.recipe}"/>
        <tr>
            <td>
                <c:out value="${recipe.name}"/>,
                <c:out value="${fn:length(recipe.components)}"/> components
            </td>
            <td>
                <a href="<c:url value="/users-recipe-get-edit.html"><c:param name="id" value="${recipe.id}"/></c:url>">View/Edit</a>
                &nbsp;&nbsp;&nbsp;
                <a href="<c:url value="/users-recipes-remove.html"><c:param name="id" value="${dishRecipe.id}"/></c:url>">Remove</a>
            </td>
        </tr>
    </c:forEach>
    <tr>
        <td colspan="2">
            <a href="<c:url value="/user-recipes-add.html"/>">Add recipe</a>
        </td>
    </tr>
</table>

</body>
</html>